//package android_board;
//
//import android.widget.Toast;
//import android_codebehind.AndroidGUICar;
//import dk.dtu.compute.course02312.matadordel2.MainActivity;
//
//public class AndroidGUI {
//
//	private static AndroidGUIBoardController bc;
//
//	private AndroidGUI() {
//	}
//
//	/**
//	 * Retrieves the singleton instance.<br>
//	 * 
//	 * @return the Board instance
//	 */
//	static AndroidGUIBoardController getBC() {
//		if (bc == null) {
//			bc = new AndroidGUIBoardController();
//		}
//		return bc; 
//	}
//    /**
//     * Closes the GUI, so you can start a new one. 
//     */
//	public static void close() {
//		getBC().closeGUI();
//		bc = null;
//		// FieldFactory.path = null;
//	}
//    /**
//    * Displays a message to the user.<br>
//    * Breaks the system untill "OK" is pressed.<br>
//    * @param msg The message to print.
//    */
//	public static void showMessage(String msg){
//		getBC().getInput(msg, false, false, null, new String[] {"OK"});
//	}
//	/** Displays a message to the user.<br>
//	 * @param msg The message to print
//	 * @param button The text for the button<br>
//	 * When the button is pressed the method returns. */
//	public static void showMessage(String msg, String button) {
//		getBC().getInput(msg, false, false, null, new String [] {button});
//	}
//	/** Displays a message, an input-textfield and an "OK"-button
//	 * @param msg The message to print<br>
//	 * @return the input string */
//	public static String getUserString(String msg){
//		return getBC().getInput(msg, true, false, null, new String[] {"OK"})[0];
//	}
//	/** Displays a message, an input-textfield and buttons
//	 * @param msg The message to print
//	 * @param buttons One or more buttons<br>
//	 * @return the input string at index 0 and the button pressed at index 1 */
//	public static String[] getUserString(String msg, String... buttons){
//		return getBC().getInput(msg, true, false, null, buttons);
//	}
//    /**
//     * Displays a message to the user and awaits the button pressed response.<br>
//     * @param msg The message that promts the user.
//     * @param buttons A number of strings that should be printed on the buttons
//     *        the user can press.
//     * @return The string from the button that the user pressed.
//     */
//	public static String getUserButtonPressed(String msg, String... buttons){
//		return getBC().getInput(msg, false, false, null, buttons)[1];
//	}
//    /**
//     * Displays a message to the user and awaits the drop-down response.<br>
//     * @param msg The message that promts the user.
//     * @param items A number of strings with the texts that the user should
//     *        choose from.
//     * @return The string that the user selected.
//     */
//	public static String getUserDropDownSelection(String msg, String... items){
//		return getBC().getInput(msg, false, true, items, new String[] {"OK"})[2];
//	}
//	/** Displays a message and a drop down menu
//	 * @param msg The message to print
//	 * @param items Elements in the drop down menu
//	 * @param button The button
//	 * @return the selected item
//	 */
//	public static String getUserDropDownSelection(String msg, String button, String... items){
//		return getBC().getInput(msg, false, true, items, new String[] {button})[2];
//	}
//	/** This one is very complex - Just stay away...
//	 * @param msg
//	 * @param showInputField
//	 * @param showDropDown
//	 * @param items
//	 * @param buttons
//	 * @return EVERYTHING */
//	public static String[] getInput(String msg, boolean showInputField, boolean showDropDown, String[] items, String[] buttons){
//		return getBC().getInput(msg, showInputField, showDropDown, items, buttons);
//	}
//	public static void toast(final String msg){
//		MainActivity.context.runOnUiThread(new Runnable() {
//			@Override public void run() {
//				Toast.makeText(MainActivity.context, msg, Toast.LENGTH_SHORT).show();
//			}
//		});
//	}
//	/**
//	 * Sets the title of a field on the board.<br>
//	 * 
//	 * @param fieldNumber
//	 *            : int [1:40]
//	 * @param title
//	 *            : String (Mind the length!)
//	 */
//	public static void setTitleText(final int fieldNumber, final String title) {
//		MainActivity.context.runOnUiThread(new Runnable() {
//			@Override public void run() {
//				getBC().setTitleText(fieldNumber, title);
//			}
//		});
//	}
//	/**
//	 * Sets the subText of a field on the board.<br>
//	 * 
//	 * @param fieldNumber
//	 *            : int [1:40]
//	 * @param subText
//	 *            : String (Mind the length!)
//	 */
//	public static void setSubText(final int fieldNumber, final String subText) {
//		MainActivity.context.runOnUiThread(new Runnable() {
//			@Override public void run() {
//				getBC().setSubText(fieldNumber, subText);
//			}
//		});
//	}
//	/**
//	 * Sets the Description (The text shown in the center when mouse hovers) of
//	 * a field on the board.<br>
//	 * 
//	 * @param fieldNumber
//	 *            : int [1:40]
//	 * @param description
//	 *            : String (Mind the length!)
//	 */
//	public static void setDescriptionText(final int fieldNumber, final String description) {
//		MainActivity.context.runOnUiThread(new Runnable() {
//			@Override public void run() {
//				getBC().setDescriptionText(fieldNumber, description);
//			}
//		});
//	}
//    /**
//     * Adds a player to the board.<br>
//     * Max. 6 players.<br>
//     * @param name : String (Mind the length!) (Unique identifier of the player - no duplicates)
//     * @param balance : int
//     * @param car : Car
//     * Cars are created this way:<br>
//     *   Car car = new Car.Builder()<br>
//     *     .primaryColor(Color.MAGENTA)<br>
//     *     .secondaryColor(Color.BLUE)<br>
//     *     .typeTractor()<br>
//     *     .patternDotted()<br>
//     *     .Build();<br>
//     */
//    public static void addPlayer(final String name, final int balance, final AndroidGUICar car) {
//		MainActivity.context.runOnUiThread(new Runnable() {
//			@Override public void run() {
//		        getBC().addPlayer(name, balance, car);
//			}
//		});
//    }
//    /**
//     * Adds a player to the board.<br>
//     * Max. 6 players.<br>
//     * @param playerName : String (Mind the length!) (Unique identifier of the player - no duplicates)
//     * @param playerScore : int
//     */
//	public static void addPlayer(final String playerName, final int playerScore) {
//		MainActivity.context.runOnUiThread(new Runnable() {
//			@Override public void run() {
//				getBC().addPlayer(playerName, playerScore);
//			}
//		});
//	}
//    /**
//     * Sets the balance of a player if the player has been added.
//     * @param name The name of the player
//     * @param newBalance : int
//     */
//	public static void setBalance(final String name, final int newBalance) {
//		MainActivity.context.runOnUiThread(new Runnable() {
//			@Override public void run() {
//				getBC().setBalance(name, newBalance);
//			}
//		});
//	}
//	/**
//	 * Shows two dice on the board. The dice will have the specified values, but
//	 * the placement is random.<br>
//	 * 
//	 * @param faceValue1
//	 *            : int [1:6]
//	 * @param rotation1
//	 *            : int [0:360]
//	 * @param faceValue2
//	 *            : int [1:6]
//	 * @param rotation2
//	 *            : int [0:360[
//	 * @param x1
//	 *            : int [0:11]
//	 * @param y1
//	 *            : int [0:11]
//	 * @param x2
//	 *            : int [0:11]
//	 * @param y2
//	 *            : int [0:11]<br>
//	 *            (If a parameter is out of bounds nothing will happen!)
//	 */
//	public static void setDice(final int faceValue1, final int rotation1, final int x1, final int y1,
//			final int faceValue2, final int rotation2, final int x2, final int y2) {
//		MainActivity.context.runOnUiThread(new Runnable() {
//			@Override public void run() {
//				getBC().setDice(faceValue1, rotation1, x1, y1, faceValue2, rotation2,
//						x2, y2);
//			}
//		});
//	}
//	/**
//	 * Shows two dice on the board. The dice will have the specified values, but
//	 * the placement is random.<br>
//	 * 
//	 * @param faceValue1
//	 *            : int [1:6]
//	 * @param faceValue2
//	 *            : int [1:6]
//	 * @param x1
//	 *            : int [0:11]
//	 * @param y1
//	 *            : int [0:11]
//	 * @param x2
//	 *            : int [0:11]
//	 * @param y2
//	 *            : int [0:11]<br>
//	 *            (If a parameter is out of bounds nothing will happen!)
//	 */
//	public static void setDice(final int faceValue1, final int x1, final int y1, final int faceValue2,
//			final int x2, final int y2) {
//		MainActivity.context.runOnUiThread(new Runnable() {
//			@Override public void run() {
//				getBC().setDice(faceValue1, x1, y1, faceValue2, x2, y2);
//			}
//		});
//	}
//	/**
//	 * Shows two dice on the board. The dice will have the specified values, but
//	 * the placement is random.<br>
//	 * 
//	 * @param faceValue1
//	 *            : int [1:6]
//	 * @param rotation1
//	 *            : int [0:360]
//	 * @param faceValue2
//	 *            : int [1:6]
//	 * @param rotation2
//	 *            : int [0:360[<br>
//	 *            (If a parameter is out of bounds nothing will happen!)
//	 */
//	public static void setDice(final int faceValue1, final int rotation1, final int faceValue2,
//			final int rotation2) {
//		MainActivity.context.runOnUiThread(new Runnable() {
//			@Override public void run() {
//				getBC().setDice(faceValue1, rotation1, faceValue2, rotation2);
//			}
//		});
//	}
//	/**
//	 * Shows two dice on the board. The dice will have the specified values, but
//	 * the placement is random.<br>
//	 * 
//	 * @param faceValue1
//	 *            : int [1:6]
//	 * @param faceValue2
//	 *            : int [1:6]<br>
//	 *            (If a parameter is out of bounds nothing will happen!) Uses
//	 *            random rotation.
//	 */
//	public static void setDice(final int faceValue1, final int faceValue2) {
//		MainActivity.context.runOnUiThread(new Runnable() {
//			@Override public void run() {
//				getBC().setDice(faceValue1, faceValue2);
//			}
//		});
//	}
//    /**
//     * Sets the text to appear in the center and displays it.
//     * @param txt : String (Mind the length!)<br>
//     */
//    public static void displayChanceCard(final String txt) {
//		MainActivity.context.runOnUiThread(new Runnable() {
//			@Override public void run() {
//		        getBC().displayChanceCard(txt);
//			}
//		});
//    }
//    /**
//     * Sets the text to appear in the center when calling displayChanceCard() and when the deck is pressed.
//     * @param txt : String (Mind the length!)<br>
//     */
//    public static void setChanceCard(final String txt) {
//		MainActivity.context.runOnUiThread(new Runnable() {
//			@Override public void run() {
//		        getBC().setChanceCard(txt);
//			}
//		});
//    }
//    /**
//     * Displays the current chance card text in the center.
//     */
//    public static void displayChanceCard() {
//		MainActivity.context.runOnUiThread(new Runnable() {
//			@Override public void run() {
//		        getBC().displayChanceCard();
//			}
//		});
//    }
//	/**
//	 * Places a car on the field.<br>
//	 * All cars can be placed on the same field.<br>
//	 * A car can only be placed if the corresponding player has been added.<br>
//	 * If a car is placed on the same field multiple times, nothing more
//	 * happens.<br>
//	 * A car can not be placed on multiple fields simultaneously.
//	 * 
//	 * @param fieldNumber
//	 *            : int [1:40]
//	 * @param name
//	 *            The name of the player
//	 */
//	public static void setCar(final int fieldNumber, final String name) {
//		MainActivity.context.runOnUiThread(new Runnable() {
//			@Override public void run() {
//				getBC().setCar(fieldNumber, name);
//			}
//		});
//	}
//	/**
//	 * Removes a car from the board.<br>
//	 * If the car is not on the board, nothing happens.
//	 * 
//	 * @param fieldNumber
//	 *            : int [1:40]
//	 * @param name
//	 *            The name of the player
//	 */
//	public static void removeCar(final int fieldNumber, final String name) {
//		MainActivity.context.runOnUiThread(new Runnable() {
//			@Override public void run() {
//				getBC().removeCar(fieldNumber, name);
//			}
//		});
//	}
//	/**
//	 * Removes all cars belonging to this player.
//	 * 
//	 * @param name
//	 *            The name of the player.
//	 */
//	public static void removeAllCars(final String name) {
//		MainActivity.context.runOnUiThread(new Runnable() {
//			@Override public void run() {
//				getBC().removeAllCars(name);
//			}
//		});
//	}
//	/**
//	 * Sets an owner of a field.<br>
//	 * The field border will have the same color as the player. The owners name
//	 * will be printed in the subText. If the field is not a street, shipping or
//	 * a brewery nothing happens.<br>
//	 * If the owner hasn't been added to the board, nothing happens.
//	 * 
//	 * @param fieldNumber
//	 *            : int [1:40]
//	 * @param prefix
//	 *            The text to put in front of the players name on the
//	 *            description of a field that the player owns.
//	 * @param name
//	 *            The name of the player
//	 * @param postfix
//	 *            The text to put after of the players name on the description
//	 *            of a field that the player owns.
//	 */
//	public static void setOwner(final int fieldNumber, final String prefix, final String name,
//			final String postfix) {
//		MainActivity.context.runOnUiThread(new Runnable() {
//			@Override public void run() {
//				getBC().setOwner(fieldNumber, prefix, name, postfix);
//			}
//		});
//	}
//	/**
//	 * Removes an owner from the field.<br>
//	 * If the field has no owner, nothing happens.
//	 * 
//	 * @param fieldNumber
//	 *            : int [1:40]
//	 */
//	public static void removeOwner(final int fieldNumber) {
//		MainActivity.context.runOnUiThread(new Runnable() {
//			@Override public void run() {
//				getBC().removeOwner(fieldNumber);
//			}
//		});
//	}
//	/**
//	 * Sets houses from the street, and removes the hotel if one is present.<br>
//	 * If houseCount is out of bounds, nothing happens.<br>
//	 * If the field is not a street, nothing happens.<br>
//	 * 
//	 * @param fieldNumber
//	 *            : int [1:40]
//	 * @param houseCount
//	 *            : int [0:4]
//	 */
//	public static void setHouses(final int fieldNumber, final int houseCount) {
//		MainActivity.context.runOnUiThread(new Runnable() {
//			@Override public void run() {
//				getBC().setHouses(fieldNumber, houseCount);
//			}
//		});
//	}
//	/**
//	 * Sets whether or not a hotel should be on the street and removes all
//	 * houses if any is present.<br>
//	 * 
//	 * @param fieldNumber
//	 *            : int [1:40]
//	 * @param hasHotel
//	 *            : boolean
//	 */
//	public static void setHotel(final int fieldNumber, final boolean hasHotel) {
//		MainActivity.context.runOnUiThread(new Runnable() {
//			@Override public void run() {
//				getBC().setHotel(fieldNumber, hasHotel);
//			}
//		});
//	}
//
//}
